﻿<?xml version="1.0" encoding="utf-8"?>
<xsd:schema id="Co_DataTransformationPrototypeSchema" targetNamespace="http://schemas.microsoft.com/dsltools/Co_DataTransformationPrototype" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/dsltools/Co_DataTransformationPrototype" xmlns:core="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:import id="CoreSchema" namespace="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" />
  <!-- ModelRoot -->
  <xsd:element name="modelRoot" type="ModelRoot" substitutionGroup="namedElement" />
  <xsd:complexType name="ModelRoot">
    <xsd:annotation>
      <xsd:documentation>The root in which all other elements are embedded. Appears as a diagram.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="NamedElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Relationship: ModelRootHasTypes -->
          <xsd:element name="types" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of ModelRootHasTypes</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element ref="modelRootHasTypes" minOccurs="0" maxOccurs="unbounded">
                  <xsd:annotation>
                    <xsd:documentation>[Instance of ModelRootHasTypes needs to be serialized in full-form]</xsd:documentation>
                  </xsd:annotation>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- dslVersion -->
        <xsd:attribute name="dslVersion" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Version of the model serialized in this file.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ModelRoot Moniker -->
  <xsd:element name="modelRootMoniker" type="ModelRootMoniker" substitutionGroup="namedElementMoniker" />
  <xsd:complexType name="ModelRootMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ModelRoot instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="NamedElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Entity -->
  <xsd:element name="entity" type="Entity" substitutionGroup="modelType" />
  <xsd:complexType name="Entity">
    <xsd:complexContent>
      <xsd:extension base="ModelType">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Relationship: EntityHasAttributes -->
          <xsd:element name="entityAttributes" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of EntityHasAttributes</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element ref="entityHasAttributes" minOccurs="1" maxOccurs="unbounded">
                  <xsd:annotation>
                    <xsd:documentation>[Instance of EntityHasAttributes needs to be serialized in full-form]</xsd:documentation>
                  </xsd:annotation>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <!-- Relationship: EntityAssociation -->
          <xsd:element name="targets" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of EntityAssociation</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element ref="entityAssociation" minOccurs="0" maxOccurs="unbounded">
                  <xsd:annotation>
                    <xsd:documentation>[Instance of EntityAssociation needs to be serialized in full-form]</xsd:documentation>
                  </xsd:annotation>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- Property: IsImported -->
        <xsd:attribute name="isImported" type="xsd:boolean" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Entity Moniker -->
  <xsd:element name="entityMoniker" type="EntityMoniker" substitutionGroup="modelTypeMoniker" />
  <xsd:complexType name="EntityMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Entity instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="ModelTypeMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- EntityAttribute -->
  <xsd:element name="entityAttribute" type="EntityAttribute" substitutionGroup="namedElement" />
  <xsd:complexType name="EntityAttribute">
    <xsd:annotation>
      <xsd:documentation>An attribute of an entity</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="NamedElement">
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- Property: Type -->
        <xsd:attribute name="type" type="xsd:string" />
        <!-- Property: isPrimaryKey -->
        <xsd:attribute name="isPrimaryKey" type="xsd:boolean" />
        <!-- Property: isForeignKey -->
        <xsd:attribute name="isForeignKey" type="xsd:boolean" />
        <!-- Property: InitialValue -->
        <xsd:attribute name="initialValue" type="xsd:string" />
        <!-- Property: Multiplicity -->
        <xsd:attribute name="multiplicity" type="xsd:string" />
        <!-- Property: CurrentEntityID -->
        <xsd:attribute name="currentEntityID" type="xsd:string" />
        <!-- Property: ReferencedEntityID -->
        <xsd:attribute name="referencedEntityID" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- EntityAttribute Moniker -->
  <xsd:element name="entityAttributeMoniker" type="EntityAttributeMoniker" substitutionGroup="namedElementMoniker" />
  <xsd:complexType name="EntityAttributeMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for EntityAttribute instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="NamedElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- NamedElement -->
  <xsd:element name="namedElement" abstract="true" type="NamedElement" substitutionGroup="core:modelElement" />
  <xsd:complexType name="NamedElement" abstract="true" >
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- Property: Name -->
        <xsd:attribute name="name" type="xsd:string" use="required" />
        <!-- Property: CurrentName -->
        <xsd:attribute name="currentName" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- NamedElement Moniker -->
  <xsd:element name="namedElementMoniker" abstract="true" type="NamedElementMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="NamedElementMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for NamedElement instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="name" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ModelType -->
  <xsd:element name="modelType" abstract="true" type="ModelType" substitutionGroup="namedElement" />
  <xsd:complexType name="ModelType" abstract="true" >
    <xsd:complexContent>
      <xsd:extension base="NamedElement">
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ModelType Moniker -->
  <xsd:element name="modelTypeMoniker" abstract="true" type="ModelTypeMoniker" substitutionGroup="namedElementMoniker" />
  <xsd:complexType name="ModelTypeMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ModelType instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="NamedElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- EntityHasAttributes -->
  <xsd:element name="entityHasAttributes" type="EntityHasAttributes" substitutionGroup="core:modelElement" />
  <xsd:complexType name="EntityHasAttributes">
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Target end EntityAttribute -->
          <xsd:element ref="entityAttribute" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>[Target role-player]</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- EntityHasAttributes Moniker -->
  <xsd:element name="entityHasAttributesMoniker" type="EntityHasAttributesMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="EntityHasAttributesMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for EntityHasAttributes instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ModelRootHasTypes -->
  <xsd:element name="modelRootHasTypes" type="ModelRootHasTypes" substitutionGroup="core:modelElement" />
  <xsd:complexType name="ModelRootHasTypes">
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Target end ModelType -->
          <xsd:element ref="modelType" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>[Target role-player]</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ModelRootHasTypes Moniker -->
  <xsd:element name="modelRootHasTypesMoniker" type="ModelRootHasTypesMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="ModelRootHasTypesMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ModelRootHasTypes instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- EntityAssociation -->
  <xsd:element name="entityAssociation" type="EntityAssociation" substitutionGroup="core:modelElement" />
  <xsd:complexType name="EntityAssociation">
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Target end Entity -->
          <xsd:element ref="entityMoniker" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>[Target role-player]</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- Property: AttributeInSource -->
        <xsd:attribute name="attributeInSource" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Key attribute on which the link is established (usually the primary key)</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- Property: AttributeInTarget -->
        <xsd:attribute name="attributeInTarget" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Key attribute on which the link is established (usually the foreign key)</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- Property: DoCascadeDelete -->
        <xsd:attribute name="doCascadeDelete" type="xsd:boolean" />
        <!-- Property: DoCascadeUpdate -->
        <xsd:attribute name="doCascadeUpdate" type="xsd:boolean" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- EntityAssociation Moniker -->
  <xsd:element name="entityAssociationMoniker" type="EntityAssociationMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="EntityAssociationMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for EntityAssociation instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Enum StateType -->
  <xsd:simpleType name="StateType">
    <xsd:annotation>
      <xsd:documentation>Indicates the state of the model element</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="Unchanged"/>
      <xsd:enumeration value="Created"/>
      <xsd:enumeration value="Removed"/>
      <xsd:enumeration value="Renamed"/>
      <xsd:enumeration value="DataTypeChanged"/>
      <xsd:enumeration value="Modified">
        <xsd:annotation>
          <xsd:documentation>Indicates that the attributes of an entity have been modified</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration value="Imported"/>
    </xsd:restriction>
  </xsd:simpleType>
  
</xsd:schema>

